package com.example.chapter1.Controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Value("${db.url}")
    private String url;

    @Value("${db.user}")
    private String user;

    @Value("${db.password}")
    private String password;

    @GetMapping("/test")
    public String test(){
        String str="<h1>当前环境链接的数据库URL:"+url+"</h1>";
        str+="<h1>数据库用户:"+user+"</h1>";
        str+="<h1>数据库密码:"+password+"</h1>";
        return str;
    }
}
